package com.win.resource.service.impl;

import com.win.resource.dao.UserDao;
import com.win.resource.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

//@Service(value = "UserServiceImpl") //name可以省略
@Service("userServiceImpl")
public class UserServiceImpl implements UserService {

//    不指定名称,根据属性名称进行注入 : myUserDao
    @Resource
    private UserDao myUserDao;

    @Override
    public void add() {
        myUserDao.add();
        System.out.println("Service层执行结束");
    }
}
